using System;
using SharpWind.Resources;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SharpWind.Graphics.Text
{
	public class TextBlock
	{
		#region Fields

		private Font font = null;

		private string text	= string.Empty;

		private Vector2 position = Vector2.Zero;

		private Color color	= Color.White;

		private float rotation = 0f;

		private Vector2 origin = Vector2.Zero;

		private Vector2 scale = Vector2.One;

		private SpriteEffects spriteEffects = SpriteEffects.None;

		private float layerDepth = 0f;

		private bool visible = true;

		#endregion

		#region Constructors

		public TextBlock( Font font, string text, Vector2 position, Color color )
		{
			this.font		= font;
			this.text		= text;
			this.position	= position;
			this.color		= color;
		}

		public TextBlock( Font font, string text, Vector2 position, Color color,
						  float rotation, Vector2 origin, Vector2 scale, SpriteEffects spriteEffects,
						  float layerDepth ) : this( font, text, position, color )
		{
			this.rotation		= rotation;
			this.origin			= origin;
			this.scale			= scale;
			this.spriteEffects	= spriteEffects;
			this.layerDepth		= layerDepth;
		}

		public TextBlock( Font font, string text, Vector2 position, Color color,
				  float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects,
				  float layerDepth ) 
			: this( font, text, position, color, rotation, origin, new Vector2( scale, scale ), spriteEffects, layerDepth )
		{

		}

		#endregion

		#region Properties

		public Font Font
		{
			get
			{
				return this.font;
			}
		}

		public string Text
		{
			get
			{
				return this.text;
			}
			set
			{
				this.text = value;
			}
		}

		public Vector2 Position
		{
			get
			{
				return this.position;
			}
			set
			{
				this.position = value;
			}
		}

		public Color Color
		{
			get
			{
				return this.color;
			}
			set
			{
				this.color = value;
			}
		}

		public float Rotation
		{
			get
			{
				return this.rotation;
			}
			set
			{
				this.rotation = value;
			}
		}

		public Vector2 Origin
		{
			get
			{
				return this.origin;
			}
			set
			{
				this.origin = value;
			}
		}

		public Vector2 Scale
		{
			get
			{
				return this.scale;
			}
			set
			{
				this.scale = value;
			}
		}

		public SpriteEffects SpriteEffects
		{
			get
			{
				return this.spriteEffects;
			}
			set
			{
				this.spriteEffects = value;
			}
		}

		public float LayerDepth
		{
			get
			{
				return this.layerDepth;
			}
			set
			{
				this.layerDepth = value;
			}
		}

		public bool Visible
		{
			get
			{
				return this.visible;
			}
			set
			{
				this.visible = value;
			}
		}

		#endregion
	}
}
